//
//  ViewController.m
//  16-封装collectionView轮播图
//
//  Created by 冀永金 on 16/8/4.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "ViewController.h"
#import "YJCycleImage.h"
#import "CyCleCollectionViewcCell.h"
@interface ViewController ()<YJCycleImageDataSource,CycleDlelegate>
@property (weak, nonatomic) IBOutlet YJCycleImage *cycleImage;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
//    YJCycleImage *cycle = [[YJCycleImage alloc]initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 300)];
//      [self.view addSubview:cycle];
    NSMutableArray *marr = [NSMutableArray array];
    for (int i = 1; i < 12; i++) {
        NSString *name = [NSString stringWithFormat:@"123_%d",i];
        UIImage *image = [UIImage imageNamed:name];
        [marr addObject:image];
    }
    NSString *image1 = [marr firstObject];
    NSArray *image2 = [marr lastObject];
    [marr insertObject:image2 atIndex:0];
    [marr addObject:image1];
    _cycleImage.array = marr;
    NSMutableArray *marr1 = [NSMutableArray arrayWithObjects:@"11",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"1",nil];
    _cycleImage.labelArray = marr1;
    _cycleImage.dataSource =self;
          // Do any additional setup after loading the view, typically from a nib.
}

- (void)handleDataWithObject:(NSString *)objc cell:(CyCleCollectionViewcCell *)cell {
    cell.cycleImage.image = [UIImage imageNamed:objc];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
